/*
 * Wire
 * Copyright (C) 2018 Wire Swiss GmbH
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see http://www.gnu.org/licenses/.
 *
 */

user-input {
  color: #fff;
  display: block;
  position: relative;
  background: fade(#fff, 8%);
  border-radius: 4px;

  &.user-list-light {
    background: fade(@w-gray, 16%);
    color: @graphite-dark;
  }
}

.search-outer {
  padding: 4px 8px;
  overflow: hidden;
}

.search-inner-wrap {
  overflow-x: hidden;
}

.search-inner {
  .hide-scrollbar;
  display: flex;
  flex-wrap: wrap;
  margin-right: -17px;
  max-height: 84px;
  overflow-y: auto;
}

.search-inner > span {
  .label-bold-xs();
  flex: 0 0 auto;
  line-height: @line-height-lg;
  padding-right: 16px;
  position: relative;

  &::before {
    .dot-size(2px);
    background-color: fade(#fff, 40%);
    content: '';
    position: absolute;
    right: 7px;
    top: 11px;

    .user-list-light & {
      background-color: fade(#222, 40%);
    }
  }

  &:last-child {
    margin-right: 8px;
  }
}

.search-inner > input {
  appearance: none;
  border: none;
  background-color: transparent;
  color: currentColor;
  flex: 1 1;
  height: @avatar-diameter-xs;
  line-height: @avatar-diameter-xs;
  min-width: 65px;
  outline: none;

  &:invalid {
    box-shadow: none;
  }

  &::placeholder {
    &:invalid {
      color: fade(#fff, 40%);
    }
    .label-xs();
    color: fade(#fff, 40%);
    padding-left: 8px;
  }

  // hack for chrome to fix line height issue
  &::-webkit-input-placeholder {
    transform: translateY(-2px);
  }

  .user-list-light & {
    &::placeholder {
      color: fade(@graphite-dark, 40%);
    }
  }
}

.search-icon {
  height: @avatar-diameter-xs;
  line-height: @avatar-diameter-xs;
  margin-right: 8px;
}

.search-input-show-placeholder {
  margin-right: 41px;
}
